package cn.wolfcode.crm.query;

import cn.wolfcode.crm.domain.SpendPoint;
import lombok.Getter;
import lombok.Setter;
import org.apache.shiro.util.StringUtils;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@Setter@Getter
public class SpendPointQueryObject extends QueryObject{
    private String sn;
    private Long parentId;
    private String sort;//哪个列
    private String order;//什么顺序
    private SpendPoint parent;

    /**
     * 现在只是将高级查询的前台传递过来的参数,传递到后台进行查询
     * 就只要贴一个注解
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date beginDate;

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date endDate;

    public String getSn(){
        return StringUtils.hasLength(sn) ? sn : "";
    }
}
